﻿using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ZH.Infrastructure.Attr;
using ZH.Infrastructure.Dto.Response;
using ZH.Infrastructure.IOC;
using ZH.Service.Interface;

namespace ZH.Service.Instance
{
    [Inject_]
    public class Dictionary_Service : Base_Service, I_dictionary_Service
    {
        private readonly Dictionary_IOC _dictionary_IOC;

        public Dictionary_Service(Dictionary_IOC dictionary_IOC)
        {
            _dictionary_IOC = dictionary_IOC;
        }

        public async Task<Api_Response_Dto> Get_Cashier_Dictionarys()
        {
            var data = await _dictionary_IOC._dictionary_EFCore.QueryAll( ).ToListAsync();

            var total = data.Count();

            return Result(1, "ok", new
            {
                total,
                data
            });
        }
    }
}
